<?php
/**
 * This is the main/default page template.
 *
 * For a quick explanation of b2evo 2.0 skins, please start here:
 * {@link http://manual.b2evolution.net/Skins_2.0}
 *
 * The main page template is used to display the blog when no specific page template is available
 * to handle the request (based on $disp).
 *
 * @package evoskins
 * @subpackage zeke
 *
 * @version $Id: posts.main.php,v 1.10 2009/01/21 20:33:49 fplanque Exp $
 */
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );

if( version_compare( $app_version, '3.0' ) < 0 )
{ // b2evo v3.x skins may not work on older b2evo versions.
	die( 'This skin is designed for b2evolution 3.0 and above. Please <a href="http://b2evolution.net/downloads/index.html">upgrade your b2evolution</a>.' );
}

// This is the main template; it may be used to display very different things.
// Do inits depending on current $disp:
skin_init( $disp );


// -------------------------- HTML HEADER INCLUDED HERE --------------------------
skin_include( '_html_header.inc.php' );
// Note: You can customize the default HTML header by copying the generic
// /skins/_html_header.inc.php file into the current skin folder.
// -------------------------------- END OF HEADER --------------------------------
?>


<?php
// ------------------------- BODY HEADER INCLUDED HERE --------------------------
skin_include( '_body_header.inc.php' );
// Note: You can customize the default BODY header by copying the generic
// /skins/_body_footer.inc.php file into the current skin folder.
// ------------------------------- END OF HEADER --------------------------------
?>

<div id="main">

	<div id="contentwrapper">

	<?php
	// -------------------------- BEGIN FEATURED/INTRO POST ---------------------------
	// Go Grab the featured post:
	if( $Item = & get_featured_Item() )
	{
		?>
		<div class="featurepost">

			<?php
				$Item->edit_link( array( // Link to backoffice for editing
							'before'    => '<div class="floatright">',
							'after'     => '</div> <!-- end of class="floatright" -->',
						) );
			?>

			<h2 class="topTitle"><?php $Item->title(); ?></h2>

			<p class="postinfo">
			<?php
				if( $Item->is_featured() )
				{	// Featured post, display extra info: (as opposed to intro posts which are also displayed here):
      		$Item->author( array(
						'before'       => T_('by').' ',
						'after'        => ' ',
					) );
					$Item->issue_time( array(
							'before'      => /* TRANS: date */ T_('on '),
							'after'       => '',
							'time_format' => 'M.d, Y'.',',
						) );
					$Item->categories( array(
							'before'          => ''.T_('under '),
							'after'           => ' ',
							'include_main'    => true,
							'include_other'   => true,
							'include_external'=> true,
							'link_categories' => true,
						) );
					// Link to comments, trackbacks, etc.:
					$Item->feedback_link( array(
							'type' => 'feedbacks',
							'link_before' => ' | ',
							'link_after' => '',
							'link_text_zero' => '#',
							'link_text_one' => '#',
							'link_text_more' => '#',
							'link_title' => '#',
							'use_popup' => false,
						) );
				}
			?>
			</p>

			<?php
				// ---------------------- POST CONTENT INCLUDED HERE ----------------------
				skin_include( '_item_content.inc.php', array(
						'image_size'     => 'fit-400x320',
						'more_link_text' => '<div class="topContent">'.T_('(continue reading...)').'</div> <!-- end of class="topContent" -->',
					) );
				// Note: You can customize the default item feedback by copying the generic
				// /skins/_item_feedback.inc.php file into the current skin folder.
				// -------------------------- END OF POST CONTENT -------------------------
			?>

			<?php
				// List all tags attached to this post:
				$Item->tags( array(
						'before' =>         '<span class="posttags">'.T_('<em>:</em>').': ',
						'after' =>          '</span>',
						'separator' =>      ', ',
					) );
			?>

		</div> <!-- end of class="featurepost" -->
		<?php
	}
	// ---------------------------- END FEATURED/INTRO POST ----------------------------
	?>

	<div id="content">

	<?php
		// ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------
		request_title( array(
				'title_before'=> '<h2 class="sectionhead">',
				'title_after' => '</h2>',
				'title_none'  => '',
				'glue'        => ' - ',
				'title_single_disp' => true,
				'format'      => 'htmlbody',
			) );
		// ------------------------------ END OF REQUEST TITLE -----------------------------
	?>


	<?php
		// ------------------------- MESSAGES GENERATED FROM ACTIONS -------------------------
		messages( array(
			'block_start' => '<div class="action_messages">',
			'block_end'   => '</div> <!-- end of class="action_messages" -->',
		) );
		// --------------------------------- END OF MESSAGES ---------------------------------
	?>


	<?php
		// Display message if no post:
		display_if_empty();

		while( $Item = & mainlist_get_item() )
		{	// For each blog post, do everything below up to the closing curly brace "}"
		?>
		<div id="<?php $Item->anchor_id() ?>" class="post post<?php $Item->status_raw() ?>" lang="<?php $Item->lang() ?>">

			<?php
				$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)
			?>

			<h2 class="topTitle"><?php $Item->title(); ?></h2>

			<p class="postinfo">
			<?php
      				$Item->author( array(
						'before'       => T_('by').' ',
						'after'        => ' ',
					) );
			?>
			<?php
				$Item->issue_time( array(
						'before'      => /* TRANS: date */ T_('on '),
						'after'       => '',
						'time_format' => 'M.d, Y'.',',
					) );
			?>
			<?php
				$Item->categories( array(
						'before'          => ''.T_('under '),
						'after'           => ' ',
						'include_main'    => true,
						'include_other'   => true,
						'include_external'=> true,
						'link_categories' => true,
					) );
			?>
			<?php
				$Item->edit_link( array( // Link to backoffice for editing
						'before'    => ' | ',
						'after'     => '',
					) );
			?>
			</p>

			<?php
				// ---------------------- POST CONTENT INCLUDED HERE ----------------------
				skin_include( '_item_content.inc.php', array(
						'image_size'     => 'fit-400x320',
						'more_link_text' => '<div class="topContent">'.T_('(continue reading...)').'</div> <!-- end of class="topContent" -->',
					) );
				// Note: You can customize the default item feedback by copying the generic
				// /skins/_item_feedback.inc.php file into the current skin folder.
				// -------------------------- END OF POST CONTENT -------------------------
			?>

			<span class="topComments">
			<?php
				// Link to comments, trackbacks, etc.:
				$Item->feedback_link( array(
						'type' => 'feedbacks',
						'link_before' => '',
						'link_after' => '',
						'link_text_zero' => '#',
						'link_text_one' => '#',
						'link_text_more' => '#',
						'link_title' => '#',
						'use_popup' => false,
					) );
			?>
			</span>

			<?php
				// List all tags attached to this post:
				$Item->tags( array(
						'before' =>         '<span class="posttags">'.T_('<em>:</em>').'',
						'after' =>          '</span>',
						'separator' =>      ', ',
					) );
			?>

			<?php
				$Item->permanent_link( array(
						'before'	=>	'<span class="topMore">',
						'after'		=>	'</span>',
						'text'		=>	T_('more...'),
					) );
			?>

			<div class="cleared"></div>
		</div> <!-- end of id="item_" -->
		<?php
		locale_restore_previous();	// Restore previous locale (Blog locale)
		}
	?>

	<?php
		// -------------------- PREV/NEXT PAGE LINKS (POST LIST MODE) --------------------
		mainlist_page_links( array(
				'block_start' => '<div id="nextprevious">',
				'block_end' => '<div class="cleared"></div></div> <!-- end of id="nextprevious" -->',
	   			'prev_text' => '&#171;',
	   			'next_text' => '&#187;',
			) );
		// ------------------------- END OF PREV/NEXT PAGE LINKS -------------------------
	?>

	</div> <!-- end of id="content" -->
	</div> <!-- end of id="contentwrapper" -->


<?php
// ------------------------- SIDEBAR INCLUDED HERE --------------------------
skin_include( '_sidebar_right.inc.php' );
// Note: You can customize the default BODY footer by copying the
// _body_footer.inc.php file into the current skin folder.
// ----------------------------- END OF SIDEBAR -----------------------------
?>

	<div class="cleared"></div>
</div> <!-- end of id="main" -->

<?php
// ------------------------- SIDEBAR INCLUDED HERE --------------------------
skin_include( '_sidebar_bottom.inc.php' );
// Note: You can customize the default BODY footer by copying the
// _body_footer.inc.php file into the current skin folder.
// ----------------------------- END OF SIDEBAR -----------------------------
?>


<?php
// ------------------------- BODY FOOTER INCLUDED HERE --------------------------
skin_include( '_body_footer.inc.php' );
// Note: You can customize the default BODY footer by copying the
// _body_footer.inc.php file into the current skin folder.
// ------------------------------- END OF FOOTER --------------------------------
?>


<?php
// ------------------------- HTML FOOTER INCLUDED HERE --------------------------
skin_include( '_html_footer.inc.php' );
// Note: You can customize the default HTML footer by copying the
// _html_footer.inc.php file into the current skin folder.
// ------------------------------- END OF FOOTER --------------------------------
?>